Integrand size = 18, antiderivative size = 116 \[ \int (c+d x) (a+b \sin (e+f x))^2 \, dx=\frac {1}{2} b^2 c x+\frac {1}{4} b^2 d x^2+\frac {a^2 (c+d x)^2}{2 d}-\frac {2 a b (c+d x) \cos (e+f x)}{f}+\frac {2 a b d \sin (e+f x)}{f^2}-\frac {b^2 (c+d x) \cos (e+f x) \sin (e+f x)}{2 f}+\frac {b^2 d \sin ^2(e+f x)}{4 f^2} \]
1/2*b^2*c*x+1/4*b^2*d*x^2+1/2*a^2*(d*x+c)^2/d-2*a*b*(d*x+c)*cos(f*x+e)/f+2 *a*b*d*sin(f*x+e)/f^2-1/2*b^2*(d*x+c)*cos(f*x+e)*sin(f*x+e)/f+1/4*b^2*d*si n(f*x+e)^2/f^2
Time = 4.77 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.83 \[ \int (c+d x) (a+b \sin (e+f x))^2 \, dx=-\frac {2 \left (2 a^2+b^2\right ) (e+f x) (-2 c f+d (e-f x))+16 a b f (c+d x) \cos (e+f x)+b^2 d \cos (2 (e+f x))-16 a b d \sin (e+f x)+2 b^2 f (c+d x) \sin (2 (e+f x))}{8 f^2} \]
-1/8*(2*(2*a^2 + b^2)*(e + f*x)*(-2*c*f + d*(e - f*x)) + 16*a*b*f*(c + d*x )*Cos[e + f*x] + b^2*d*Cos[2*(e + f*x)] - 16*a*b*d*Sin[e + f*x] + 2*b^2*f* (c + d*x)*Sin[2*(e + f*x)])/f^2
Time = 0.29 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.97, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 3798, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (c+d x) (a+b \sin (e+f x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x) (a+b \sin (e+f x))^2dx\) |
\(\Big \downarrow \) 3798 |
\(\displaystyle \int \left (a^2 (c+d x)+2 a b (c+d x) \sin (e+f x)+b^2 (c+d x) \sin ^2(e+f x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 (c+d x)^2}{2 d}-\frac {2 a b (c+d x) \cos (e+f x)}{f}+\frac {2 a b d \sin (e+f x)}{f^2}-\frac {b^2 (c+d x) \sin (e+f x) \cos (e+f x)}{2 f}+\frac {b^2 (c+d x)^2}{4 d}+\frac {b^2 d \sin ^2(e+f x)}{4 f^2}\) |
(a^2*(c + d*x)^2)/(2*d) + (b^2*(c + d*x)^2)/(4*d) - (2*a*b*(c + d*x)*Cos[e + f*x])/f + (2*a*b*d*Sin[e + f*x])/f^2 - (b^2*(c + d*x)*Cos[e + f*x]*Sin[ e + f*x])/(2*f) + (b^2*d*Sin[e + f*x]^2)/(4*f^2)
3.2.59.3.1 Defintions of rubi rules used
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] || IGtQ[ m, 0] || NeQ[a^2 - b^2, 0])
Time = 0.20 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.91
method | result | size |
risch | \(\frac {a^{2} d \,x^{2}}{2}+a^{2} c x +\frac {b^{2} d \,x^{2}}{4}+\frac {b^{2} c x}{2}-\frac {2 a b \left (d x +c \right ) \cos \left (f x +e \right )}{f}+\frac {2 a b d \sin \left (f x +e \right )}{f^{2}}-\frac {b^{2} d \cos \left (2 f x +2 e \right )}{8 f^{2}}-\frac {b^{2} \left (d x +c \right ) \sin \left (2 f x +2 e \right )}{4 f}\) | \(105\) |
parallelrisch | \(\frac {-2 b^{2} f \left (d x +c \right ) \sin \left (2 f x +2 e \right )-b^{2} d \cos \left (2 f x +2 e \right )-16 a b f \left (d x +c \right ) \cos \left (f x +e \right )+16 a b d \sin \left (f x +e \right )+\left (\left (2 d \,x^{2}+4 c x \right ) f^{2}+d \right ) b^{2}-16 a b c f +8 \left (\frac {d x}{2}+c \right ) x \,f^{2} a^{2}}{8 f^{2}}\) | \(111\) |
parts | \(a^{2} \left (\frac {1}{2} d \,x^{2}+c x \right )+\frac {b^{2} \left (\frac {d \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\left (\sin ^{2}\left (f x +e \right )\right )}{4}\right )}{f}+c \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {d e \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\right )}{f}+\frac {2 a b \left (\frac {d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-c \cos \left (f x +e \right )+\frac {d e \cos \left (f x +e \right )}{f}\right )}{f}\) | \(184\) |
derivativedivides | \(\frac {a^{2} c \left (f x +e \right )-\frac {a^{2} d e \left (f x +e \right )}{f}+\frac {a^{2} d \left (f x +e \right )^{2}}{2 f}-2 a b c \cos \left (f x +e \right )+\frac {2 a b d e \cos \left (f x +e \right )}{f}+\frac {2 a b d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}+b^{2} c \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} d e \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {b^{2} d \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\left (\sin ^{2}\left (f x +e \right )\right )}{4}\right )}{f}}{f}\) | \(216\) |
default | \(\frac {a^{2} c \left (f x +e \right )-\frac {a^{2} d e \left (f x +e \right )}{f}+\frac {a^{2} d \left (f x +e \right )^{2}}{2 f}-2 a b c \cos \left (f x +e \right )+\frac {2 a b d e \cos \left (f x +e \right )}{f}+\frac {2 a b d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}+b^{2} c \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} d e \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {b^{2} d \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\left (\sin ^{2}\left (f x +e \right )\right )}{4}\right )}{f}}{f}\) | \(216\) |
norman | \(\frac {\left (\frac {1}{2} a^{2} d +\frac {1}{4} b^{2} d \right ) x^{2}+\left (a^{2} d +\frac {1}{2} b^{2} d \right ) x^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (\frac {1}{2} a^{2} d +\frac {1}{4} b^{2} d \right ) x^{2} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\frac {b \left (-b c f +4 d a \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}+\frac {b \left (b c f +4 d a \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f^{2}}+c \left (2 a^{2}+b^{2}\right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\frac {b^{2} d x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {4 a b c}{f}+\frac {\left (2 a^{2} c f +b^{2} c f -4 a b d \right ) x}{2 f}-\frac {\left (4 a b c f -b^{2} d \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f^{2}}+\frac {\left (2 a^{2} c f +b^{2} c f +4 a b d \right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}-\frac {b^{2} d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}\) | \(299\) |
1/2*a^2*d*x^2+a^2*c*x+1/4*b^2*d*x^2+1/2*b^2*c*x-2*a*b*(d*x+c)*cos(f*x+e)/f +2*a*b*d*sin(f*x+e)/f^2-1/8*b^2*d/f^2*cos(2*f*x+2*e)-1/4*b^2/f*(d*x+c)*sin (2*f*x+2*e)
Time = 0.28 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.94 \[ \int (c+d x) (a+b \sin (e+f x))^2 \, dx=\frac {{\left (2 \, a^{2} + b^{2}\right )} d f^{2} x^{2} + 2 \, {\left (2 \, a^{2} + b^{2}\right )} c f^{2} x - b^{2} d \cos \left (f x + e\right )^{2} - 8 \, {\left (a b d f x + a b c f\right )} \cos \left (f x + e\right ) + 2 \, {\left (4 \, a b d - {\left (b^{2} d f x + b^{2} c f\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, f^{2}} \]
1/4*((2*a^2 + b^2)*d*f^2*x^2 + 2*(2*a^2 + b^2)*c*f^2*x - b^2*d*cos(f*x + e )^2 - 8*(a*b*d*f*x + a*b*c*f)*cos(f*x + e) + 2*(4*a*b*d - (b^2*d*f*x + b^2 *c*f)*cos(f*x + e))*sin(f*x + e))/f^2
Time = 0.23 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.89 \[ \int (c+d x) (a+b \sin (e+f x))^2 \, dx=\begin {cases} a^{2} c x + \frac {a^{2} d x^{2}}{2} - \frac {2 a b c \cos {\left (e + f x \right )}}{f} - \frac {2 a b d x \cos {\left (e + f x \right )}}{f} + \frac {2 a b d \sin {\left (e + f x \right )}}{f^{2}} + \frac {b^{2} c x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {b^{2} d x^{2} \sin ^{2}{\left (e + f x \right )}}{4} + \frac {b^{2} d x^{2} \cos ^{2}{\left (e + f x \right )}}{4} - \frac {b^{2} d x \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {b^{2} d \sin ^{2}{\left (e + f x \right )}}{4 f^{2}} & \text {for}\: f \neq 0 \\\left (a + b \sin {\left (e \right )}\right )^{2} \left (c x + \frac {d x^{2}}{2}\right ) & \text {otherwise} \end {cases} \]
Piecewise((a**2*c*x + a**2*d*x**2/2 - 2*a*b*c*cos(e + f*x)/f - 2*a*b*d*x*c os(e + f*x)/f + 2*a*b*d*sin(e + f*x)/f**2 + b**2*c*x*sin(e + f*x)**2/2 + b **2*c*x*cos(e + f*x)**2/2 - b**2*c*sin(e + f*x)*cos(e + f*x)/(2*f) + b**2* d*x**2*sin(e + f*x)**2/4 + b**2*d*x**2*cos(e + f*x)**2/4 - b**2*d*x*sin(e + f*x)*cos(e + f*x)/(2*f) + b**2*d*sin(e + f*x)**2/(4*f**2), Ne(f, 0)), (( a + b*sin(e))**2*(c*x + d*x**2/2), True))
Time = 0.22 (sec) , antiderivative size = 202, normalized size of antiderivative = 1.74 \[ \int (c+d x) (a+b \sin (e+f x))^2 \, dx=\frac {8 \, {\left (f x + e\right )} a^{2} c + 2 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c + \frac {4 \, {\left (f x + e\right )}^{2} a^{2} d}{f} - \frac {8 \, {\left (f x + e\right )} a^{2} d e}{f} - \frac {2 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} d e}{f} - 16 \, a b c \cos \left (f x + e\right ) + \frac {16 \, a b d e \cos \left (f x + e\right )}{f} - \frac {16 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} a b d}{f} + \frac {{\left (2 \, {\left (f x + e\right )}^{2} - 2 \, {\left (f x + e\right )} \sin \left (2 \, f x + 2 \, e\right ) - \cos \left (2 \, f x + 2 \, e\right )\right )} b^{2} d}{f}}{8 \, f} \]
1/8*(8*(f*x + e)*a^2*c + 2*(2*f*x + 2*e - sin(2*f*x + 2*e))*b^2*c + 4*(f*x + e)^2*a^2*d/f - 8*(f*x + e)*a^2*d*e/f - 2*(2*f*x + 2*e - sin(2*f*x + 2*e ))*b^2*d*e/f - 16*a*b*c*cos(f*x + e) + 16*a*b*d*e*cos(f*x + e)/f - 16*((f* x + e)*cos(f*x + e) - sin(f*x + e))*a*b*d/f + (2*(f*x + e)^2 - 2*(f*x + e) *sin(2*f*x + 2*e) - cos(2*f*x + 2*e))*b^2*d/f)/f
Time = 0.32 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.99 \[ \int (c+d x) (a+b \sin (e+f x))^2 \, dx=\frac {1}{2} \, a^{2} d x^{2} + \frac {1}{4} \, b^{2} d x^{2} + a^{2} c x + \frac {1}{2} \, b^{2} c x - \frac {b^{2} d \cos \left (2 \, f x + 2 \, e\right )}{8 \, f^{2}} + \frac {2 \, a b d \sin \left (f x + e\right )}{f^{2}} - \frac {2 \, {\left (a b d f x + a b c f\right )} \cos \left (f x + e\right )}{f^{2}} - \frac {{\left (b^{2} d f x + b^{2} c f\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f^{2}} \]
1/2*a^2*d*x^2 + 1/4*b^2*d*x^2 + a^2*c*x + 1/2*b^2*c*x - 1/8*b^2*d*cos(2*f* x + 2*e)/f^2 + 2*a*b*d*sin(f*x + e)/f^2 - 2*(a*b*d*f*x + a*b*c*f)*cos(f*x + e)/f^2 - 1/4*(b^2*d*f*x + b^2*c*f)*sin(2*f*x + 2*e)/f^2
Time = 0.51 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.23 \[ \int (c+d x) (a+b \sin (e+f x))^2 \, dx=\frac {a^2\,d\,x^2}{2}+\frac {b^2\,d\,x^2}{4}+a^2\,c\,x+\frac {b^2\,c\,x}{2}-\frac {b^2\,c\,\sin \left (2\,e+2\,f\,x\right )}{4\,f}+\frac {b^2\,d\,{\sin \left (e+f\,x\right )}^2}{4\,f^2}+\frac {4\,a\,b\,c\,{\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{f}-\frac {b^2\,d\,x\,\sin \left (2\,e+2\,f\,x\right )}{4\,f}+\frac {2\,a\,b\,d\,\sin \left (e+f\,x\right )}{f^2}+\frac {2\,a\,b\,d\,x\,\left (2\,{\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}{f} \]